namespace Game.Core
{
	public class Singleton<T> : EventObject where T : new()
	{
		private static T m_Instance;

		private static readonly object m_Lock;

		public static T Instance
		{
			get
			{
				if (m_Instance == null)
				{
					lock (m_Lock)
					{
						m_Instance = new T();
					}
				}
				return m_Instance;
			}
		}

		static Singleton()
		{
			m_Lock = new object();
		}
	}
}
